namespace CSharpPro._10._21.service.impl;
public class UserServiceImpl : UserService
{

    public void add(List<String> list, String str)
    {
        list.Add(str);
        Console.WriteLine("添加成功");
    }

    public void remove(List<String> list, String str)
    {
        for (int i = 0; i < list.Count; i++)
        {
            if (list[i].Equals(str))
            {
                list.RemoveAt(i);
                Console.WriteLine("删除成功");
            }
        }
    }

    public void update(List<String> list, String str, int index)
    {
        list[index] = str;
        Console.WriteLine("修改成功");
    }

    public String select(List<String> list, int index)
    {
        return list[index];
    }
}